home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / libelf / elf_getident.z / elf_getident
Encoding:
Text File  |  2002-10-03  |  2.9 KB  |  60 lines

  1. ELF_GETIDENT(3E)                                     Last changed: 10-13-98
  2.  
  3.  
  4. NNAAMMEE
  5.      eellff__ggeettiiddeenntt - Retrieves file identification data
  6.  
  7. SSYYNNOOPPSSIISS
  8.      cccc [_f_l_a_g ...] _f_i_l_e ...  --lleellff [_l_i_b_r_a_r_y ...]
  9.  
  10.      ##iinncclluuddee <<lliibbeellff..hh>>
  11.  
  12.      cchhaarr **eellff__ggeettiiddeenntt((EEllff **eellff,, ssiizzee__tt **ppttrr));;
  13.  
  14. IIMMPPLLEEMMEENNTTAATTIIOONN
  15.      IRIX systems
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      ELF provides a framework for various classes of files, where basic
  19.      objects may have 32 bits, 64 bits, etc.  To accommodate these
  20.      differences without forcing the larger sizes on smaller machines, the
  21.      initial bytes in an ELF file hold identification information common to
  22.      all file classes.  Every ELF header's ee__iiddeenntt has EEII__NNIIDDEENNTT bytes with
  23.      the following interpretation:
  24.  
  25.  --------------------------------------------------------------------------
  26.       ee__iiddeenntt Index                Value                   Purpose
  27.  --------------------------------------------------------------------------
  28.  EI_MAG0                  ELFMAG0                   File identification
  29.  EI_MAG1                  ELFMAG1
  30.  EI_MAG2                  ELFMAG2
  31.  EI_MAG3                  ELFMAG3
  32.  EI_CLASS                 ELFCLASSNONE              File class
  33.                           ELFCLASS32
  34.                           ELFCLASS64
  35.  EI_DATA                  ELFDATANONE               Data encoding
  36.                           ELFDATA2LSB
  37.                           ELFDATA2MSB
  38.  EI_VERSION               EV_CURRENT                File version
  39.  7-15                     0                         Unused, set to zero
  40.  --------------------------------------------------------------------------
  41.  
  42.      Other kinds of files [see eellff__kkiinndd(3E)] also may have identification
  43.      data, though they would not conform to ee__iiddeenntt.
  44.  
  45.      eellff__ggeettiiddeenntt returns a pointer to the file's initial bytes.  If the
  46.      library recognizes the file, a conversion from the file image to the
  47.      memory image may occur.  In any case, the identification bytes are
  48.      guaranteed to not have been modified, though the size of the
  49.      unmodified area depends on the file type.  If ppttrr is non-null, the
  50.      library stores the number of identification bytes in the location to
  51.      which ppttrr points.  If no data are present, eellff is null, or an error
  52.      occurs, the return value is a null pointer, with zero optionally
  53.      stored through ppttrr.
  54.  
  55. SSEEEE AALLSSOO
  56.      eellff(3E), eellff__bbeeggiinn(3E), eellff__ggeetteehhddrr(3E), eellff__kkiinndd(3E), eellff__rraawwffiillee(3E)
  57.  
  58.      This man page is available only online.
  59.  
  60.